//
//  QLConfigure.h
//  QLCustomCamera
//
//  Created by 李强 on 2020/8/29.
//  Copyright © 2020 李强LiQ. All rights reserved.
//

#ifndef QLConfigure_h
#define QLConfigure_h


#endif /* QLConfigure_h */


#define QL_KNetworkError               @"网络请求失败,请重试"


//weakSelf
#define QL_WS(weakSelf)            __weak __typeof(&*self)weakSelf = self;

#define QL_KAPPWindow       [UIApplication sharedApplication].keyWindow
#define QL_AppDelegateInstance  ((AppDelegate *)[UIApplication sharedApplication].delegate)
#define QL_kNetworkError       @"网络请求失败,请重试"


#define QL_SCREEN_SIZE                 [[UIScreen mainScreen] bounds].size
#define QL_SCREEN_HEIGHT               QL_SCREEN_SIZE.height
#define QL_SCREEN_WIDTH                QL_SCREEN_SIZE.width

//下边距安全距离
#define QL_SAFEAREA_BOTTOM_HEIGH           (QL_IS_PhoneXAll ? 34.0f : 0.01f)
//上边距安全距离
#define QL_SAFEAREA_TOP_HEIGH              (QL_IS_PhoneXAll ? 44.0f : 20.0f)
//状态栏高度
#define QL_STATUS_HEIGHT  20.f
//边距
#define QL_MARGIN      20
//录制按钮大小
#define QL_STARTBTN_WIDTH      72
//时间View高度
#define QL_TIMEVIEW_HEIGHT     30
//进度条宽度
#define QL_PROGRESS_BORDER_WIDTH  8
//取消按钮大小
#define QL_CANCLEBTN_WIDTH  92
//选择按钮大小
#define QL_SELECTEDBTN_WIDTH  53

//MARK:系统型号
#define QL_IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define QL_SCREEN_MAX_LENGTH (MAX(QL_SCREEN_WIDTH, QL_SCREEN_HEIGHT))
#define QL_IS_IPHONE_4_OR_LESS (QL_IS_IPHONE && QL_SCREEN_MAX_LENGTH < 568.0)
#define QL_IS_IPHONE_5 (QL_IS_IPHONE && QL_SCREEN_MAX_LENGTH == 568.0)
#define QL_IS_IPHONE_6 (QL_IS_IPHONE && QL_SCREEN_MAX_LENGTH == 667.0)
#define QL_IS_IPHONE_P (QL_IS_IPHONE && QL_SCREEN_MAX_LENGTH == 736.0)

//判断是否是ipad
#define QL_isPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
//判断iPhoneX，Xs（iPhoneX，iPhoneXs）
#define QL_IS_IPHONE_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !QL_isPad : NO)
//判断iPhoneXr
#define QL_IS_IPHONE_XR ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !QL_isPad : NO)
//判断iPhoneXsMax
#define QL_IS_IPHONE_XS_MAX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size)&& !QL_isPad : NO)
//判断iPhoneX所有系列
#define QL_IS_PhoneXAll (QL_IS_IPHONE_X || QL_IS_IPHONE_XR || QL_IS_IPHONE_XS_MAX)


//MARK:文件夹名称
//原始文件存放文件夹
#define VIDEO_FOLDER  @"VideoFolder"




#ifdef DEBUG
#define NSSLog(fmt, ...) NSLog((@"function：%s [Line：%d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define NSLog(...)
#endif
